UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wFz+WxLkqaNlFws9Fd8Y+khGcJvhVar4hqMMjXQNBPk='
WHERE
key_id = '4d36a76d04bd8fd3542514f0ed9231ad587a6a20c4dcf1fd1f058c06dcdede1a'
AND (
token = 'wFz+WxLkqaNlFws9Fd8Y+khGcJvhVar4hqMMjXQNBPk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)