UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DCyWWH3W1QmU95T+9O6XbhCzWkAdiu87faNk9unMHP0='
WHERE
key_id = 'ff06d3ac11f2d678cbf52e953bda9a0c908b5261dae419e52d8e2ce01c0afe3a'
AND (
token = 'DCyWWH3W1QmU95T+9O6XbhCzWkAdiu87faNk9unMHP0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)