UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wUyVRgbG3muGhQkx4HWpnR1kx++j/WCRehMqznQoRYc=' 
WHERE 
  key_id = 'db96f918192d40e650e7fdf26365e9eb78df5a127a9e6eb7d9b68530789665bc' 
  AND (
    token = 'wUyVRgbG3muGhQkx4HWpnR1kx++j/WCRehMqznQoRYc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029