UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pGZjJwB1gQYJO5vGKOxnSloMMz/mutQFDG4Dpp4yuS0=' 
WHERE 
  key_id = 'c25b804d29be42927bc5f21314ffc28ede0ab516f48a8588755559e388ee9b28' 
  AND (
    token = 'pGZjJwB1gQYJO5vGKOxnSloMMz/mutQFDG4Dpp4yuS0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034