UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nHwkfQyPGvrGDZqMv6pLhn2eG6FszWlQlbgANtw8R2c=' 
WHERE 
  key_id = '2b000b3bdbe3fa3c457c3ae07923f8171862b696726588a0deda4360eb8cdd3a' 
  AND (
    token = 'nHwkfQyPGvrGDZqMv6pLhn2eG6FszWlQlbgANtw8R2c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00065