UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qa3lI9FQx4moi30bqTjkT7OR/WfHeDmsmvsOBfqTjTI='
WHERE
key_id = '0ba5ba2d891778084d4e8a5caaff16abba9c2fa7ab4bd7cfe2b99e712a8ae8a1'
AND (
token = 'qa3lI9FQx4moi30bqTjkT7OR/WfHeDmsmvsOBfqTjTI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)