UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'smi3Whmcc5H7NOh76uCYNquw+ZPShu2APCcXmAqpZaw=' 
WHERE 
  key_id = 'ca9c06d71b9e1efc894a38752cec0f9c7889f2a6fa372a2c7732559d4a620a34' 
  AND (
    token = 'smi3Whmcc5H7NOh76uCYNquw+ZPShu2APCcXmAqpZaw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026