UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'etuKWnE+WkEFg9O4oDibcV4jV7sfyvf2CeUfSEbqJxs=' 
WHERE 
  key_id = '1cbf1f490a905ede58d5f611b28747b0b506e978a8c641601df3a098b67e696d' 
  AND (
    token = 'etuKWnE+WkEFg9O4oDibcV4jV7sfyvf2CeUfSEbqJxs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044