UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'I1nKYdkrTA493D+CDkqxPGznzTxQYCAy6HPzsT05XTg='
WHERE
key_id = '9737726e8aa3baee8eb8ad118a2d6395f5b593923b24f3400b1fac1fd94a92d7'
AND (
token = 'I1nKYdkrTA493D+CDkqxPGznzTxQYCAy6HPzsT05XTg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)