UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'secKkRStdv6jnQolseqfTmdUuwZnRvZTCnD0FDTqQcM='
WHERE
key_id = '26212549ed6c49652a86ebfb73661706d467a1564fed9dc344b23f9c47a88727'
AND (
token = 'secKkRStdv6jnQolseqfTmdUuwZnRvZTCnD0FDTqQcM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)