UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'j/SGtDMU5Tl/f7ZayzKgMXh76VCyWg7ughHAEHoMiB0=' 
WHERE 
  key_id = 'eff5c1ea8bca8622c5015c7ab76ca2f97bb6cbc554882395247d043cd5833cfb' 
  AND (
    token = 'j/SGtDMU5Tl/f7ZayzKgMXh76VCyWg7ughHAEHoMiB0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029