UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QWnpU2AMGziKJSol7jepChBNxu+8+KUfMfZLVB38t8o=' 
WHERE 
  key_id = 'c9aa9ed2edf43a4fad5bd3c8d081c18e0cde12e8e5a02fabaf5dac40848dc8c7' 
  AND (
    token = 'QWnpU2AMGziKJSol7jepChBNxu+8+KUfMfZLVB38t8o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027