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