UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GypOZMRKIZ8pZRR7R6GIfTstTONvjqxl65mfE4eFnEw=' 
WHERE 
  key_id = '83e0565ace6d451994ac3e1824b70b66aa3dc2bda231598ec6728b2df5fbc893' 
  AND (
    token = 'GypOZMRKIZ8pZRR7R6GIfTstTONvjqxl65mfE4eFnEw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045