UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mi0vIDjPjkEGxiZFyez86vQOlIYgMZ1BT1TYiZz55jM=' 
WHERE 
  key_id = 'e7fa12018899e1d1823517d64646507265a64efe5a8a9e341a695220c45f6519' 
  AND (
    token = 'mi0vIDjPjkEGxiZFyez86vQOlIYgMZ1BT1TYiZz55jM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036