UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xHtet+F6yab+xtj4TY03tCSs5fkEcJhYrDlUV7947yo='
WHERE
key_id = 'fd4a26c0e87a1218d3b80efbec097214c10bd66f7de96e9d043ab294b544b2a0'
AND (
token = 'xHtet+F6yab+xtj4TY03tCSs5fkEcJhYrDlUV7947yo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)