UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zQ+QpaYtSgeQ1wxAG243ZHKYjXXgYe96JGKzqEZ6nCU=' 
WHERE 
  key_id = '62539190c95e1387454948bd7632852179bc1f3c484f2348733c2a4bff010677' 
  AND (
    token = 'zQ+QpaYtSgeQ1wxAG243ZHKYjXXgYe96JGKzqEZ6nCU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018