UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'D/GtgF5tb/1DqU9l+MlHlOp94N8JPqJbJMXL34QoDWc='
WHERE
key_id = 'b77e854db41e5509404ee885fcb955374991b336c20ad8d3509dd67cca6dbe4b'
AND (
token = 'D/GtgF5tb/1DqU9l+MlHlOp94N8JPqJbJMXL34QoDWc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)