UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VKRT9r+OhyFKNldjNwJLOjtmmj6Gr9CNAMuKHEmepqE=' 
WHERE 
  key_id = '0db2513009dee89bb906aaf0abb5109f10df8ec83df8693d3534bf0a614d6d4e' 
  AND (
    token = 'VKRT9r+OhyFKNldjNwJLOjtmmj6Gr9CNAMuKHEmepqE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033