UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+u1pLWmH1glqPVX85fdmLHJ0QX+4eEUVjS36sX17Ar4=' 
WHERE 
  key_id = 'dddd27f07283e38ae403a7dde10d86a12a7e79e83b3171dee2fffb8483279a05' 
  AND (
    token = '+u1pLWmH1glqPVX85fdmLHJ0QX+4eEUVjS36sX17Ar4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028