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

Query time 0.00043