UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PBGEtkOxDqQkPF7vaZUvryL0zerU9lwhqitDPHXw9a4=' 
WHERE 
  key_id = '19298e28e875d5a029969fa3f574848cb7259504569fa16da36fc8df628ec1f1' 
  AND (
    token = 'PBGEtkOxDqQkPF7vaZUvryL0zerU9lwhqitDPHXw9a4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015