UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7HlofQ0ubpohc1uZeUzI/TomHz64OGj6Rt4V9icsvNs='
WHERE
key_id = '063451c92443e5fe675e0c3c212e8ba5496f9011cd275052e28dd96e5a3ca516'
AND (
token = '7HlofQ0ubpohc1uZeUzI/TomHz64OGj6Rt4V9icsvNs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)