UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BBLFHKr9LYPvG1hDhy+qvX+y15wmlNitYT+ixY009fs='
WHERE
key_id = 'a2794405e392508eb74fc4f4d026b686a225959326fe398804ee4b06b244b25c'
AND (
token = 'BBLFHKr9LYPvG1hDhy+qvX+y15wmlNitYT+ixY009fs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)