UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iWfRKVtBU2Lk9+wyYSlnMkQOapX7XNTAWfu3oMXXOQY='
WHERE
key_id = 'fa2042f987e294c30c4e49cdc37c405fa25f0016fceeddc5b539d29b6da3039d'
AND (
token = 'iWfRKVtBU2Lk9+wyYSlnMkQOapX7XNTAWfu3oMXXOQY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)