UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3L7u4YjW+m1FLM4gsMOJEJaneTYuC9ewyfxvWQAR9hM='
WHERE
key_id = '15371735ea176896cae6ddadc251a077f156053e568202c93702449c38622260'
AND (
token = '3L7u4YjW+m1FLM4gsMOJEJaneTYuC9ewyfxvWQAR9hM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)