UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'b9AOMOgMX5SrKLaqv6sQE1XrhzHPXk4beLR+zteow5s='
WHERE
key_id = '2d28f7c645905cc88420408b842773bbb67a81219be35df718f13a704261b638'
AND (
token = 'b9AOMOgMX5SrKLaqv6sQE1XrhzHPXk4beLR+zteow5s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)