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