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