UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ds0Ovr55hDVIP1s4VKaYb6M5egN/Qqh9BL6QvW4L4FI=' 
WHERE 
  key_id = '5c85825fff7225232dd07dbae0451c9afcc839fd0955f6d639ed1d51c68bbe03' 
  AND (
    token = 'Ds0Ovr55hDVIP1s4VKaYb6M5egN/Qqh9BL6QvW4L4FI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029