UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uLsYqXJ6QTPegNOQDIsb8qTj7pIsqlSfF7xOFINUSLU='
WHERE
key_id = 'fc4fc3a7ef6f4b32ddf9b564d8557b1a9f768b8cd8689b45f13d0fdbbf591156'
AND (
token = 'uLsYqXJ6QTPegNOQDIsb8qTj7pIsqlSfF7xOFINUSLU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)