UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 's0OxjHcuvhUczokzWkecohjRDo5oLI5q/IIYxVEQh+8='
WHERE
key_id = 'ed204e757160afe44540c7afa4ecbfac3af5dd394a8d93437699fdd6b1d08fd1'
AND (
token = 's0OxjHcuvhUczokzWkecohjRDo5oLI5q/IIYxVEQh+8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)