UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 's+9WW3YGBqTiEJAv2EUt/ynk+aGaoeyKcCJrOONP/DA='
WHERE
key_id = '3f0a9adbae3b053c936ae53e55816e810b4b78855d7c460345aebea1e10201eb'
AND (
token = 's+9WW3YGBqTiEJAv2EUt/ynk+aGaoeyKcCJrOONP/DA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)