UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UFR/mMJCGg4VU4sGoybfskGVpG3OmGULSvT4lSLQKcc='
WHERE
key_id = 'e677fd718be5270669798e9c11f345c86d8c5a14ef66325cfe5aaac801710a5e'
AND (
token = 'UFR/mMJCGg4VU4sGoybfskGVpG3OmGULSvT4lSLQKcc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)