UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'P7YS3fpy4naDc67ZRxwZ8GBIv6U+zmGTwZG+hfe2SGk='
WHERE
key_id = '1b184ca3e896cb7279f43f782c74ad77fa420b258fe57bfd09ce8f9243c1d01b'
AND (
token = 'P7YS3fpy4naDc67ZRxwZ8GBIv6U+zmGTwZG+hfe2SGk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)