UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '27QDPHraRXql48fL8CWhPz2XOscXzmq+7Pkqt1CigSI=' 
WHERE 
  key_id = '03f38afb5be7489dfe77f0e3d7474fd70cfa5585f23c08117bda1aabee97748e' 
  AND (
    token = '27QDPHraRXql48fL8CWhPz2XOscXzmq+7Pkqt1CigSI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047