UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DD4EDEzSJztzf76an+QeHBJc9LMjYFBLfqwiJgUaSUc='
WHERE
key_id = '9407efa2f72fdcb0bcc23049f8d10fed09642921237edd7cade9cbbddcdc9186'
AND (
token = 'DD4EDEzSJztzf76an+QeHBJc9LMjYFBLfqwiJgUaSUc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)