UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tAOemmSMW4kNrVKoAXNSE29K9w65MsHsJKD6PnosANI='
WHERE
key_id = '30c9a177877c10de666d1d82dba161ebfdf05c1fd8b6e17efb35e720251674b0'
AND (
token = 'tAOemmSMW4kNrVKoAXNSE29K9w65MsHsJKD6PnosANI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)